import Vue from 'vue'
import App from './App.vue'
import store from './store';
import './plugins';
import vuetify from './plugins/vuetify';
import iziToast from './plugins/toast/izitoast';
import ElementUI from 'element-ui';
import VueParticles from 'vue-particles';
import router from './router'
import qs from 'qs';
import mavonEditor from 'mavon-editor'
import {sync} from 'vuex-router-sync';
// 引入css
import 'element-ui/lib/theme-chalk/index.css';
import 'mavon-editor/dist/css/index.css'
import 'muse-ui/dist/muse-ui.css';
import 'vue-happy-scroll/docs/happy-scroll.css';
import 'vue-multiselect/dist/vue-multiselect.min.css';
//
//引入实例
import GeminiScrollbar from 'vue-gemini-scrollbar';
import MuseUI from 'muse-ui';
import Loading from 'muse-ui-loading';
import moment from 'moment';
import Mutiselect from 'vue-multiselect';
import lodash from 'lodash';
import VueCookie from 'vue-cookie';

sync(store, router);

Vue.use(GeminiScrollbar);
Vue.use(MuseUI);
Vue.use(ElementUI);
Vue.use(Loading);
Vue.use(VueParticles);
Vue.use(VueCookie);
Vue.use(mavonEditor);

Vue.component("Mutiselect", Mutiselect);

Vue.config.productionTip = false;

//vue组件挂载
Vue.prototype.$qs = qs;
Vue.prototype.$cookie = VueCookie;
Vue.prototype.$moment = moment;
Vue.prototype.$lodash = lodash;

// 路由跳转
Vue.prototype.$goRoute = function (index, data) {
    if (data) {
        this.$router.push({
            path: index,
            name: index.substring(index.lastIndexOf("/"), index.length).replace("/", ""),
            params: {
                blog: data
            }
        })
    } else {
        this.$router.push(index)
    }

};

//过滤器
Vue.filter('dateformat', function (dataStr, pattern = 'YYYY-MM-DD HH:mm:ss') {
    return moment(dataStr).format(pattern)

});


new Vue({
    vuetify,
    iziToast,
    router,
    store,
    render: h => h(App)
}).$mount('#app');


